function toggle(eles, active) {
    nowrop.innerHTML="共"+lis+"条&nbsp;&nbsp;"+(nowpage+1)+"/"+pages.length
    //封装函数、图片显示的部分、传入获取到的div，和被点击的序号
    for (var i = eles.length; i--;) {
      eles[i].className = "item"; //先让所有div隐藏
    }
    eles[active].className = "item active"; //再让被点击的序号对应的div 显示
  }
  var pages=document.querySelectorAll(".item");
  var lis = document.querySelectorAll(".item li").length;
  console.log(lis)
  var prev=document.querySelector(".prev");
  var next=document.querySelector(".next");
  var first=document.querySelector(".first");
  var last=document.querySelector(".last");
  var jump=document.querySelector(".jump");
  var yema=document.querySelector(".yema");
  var nowrop=document.querySelector(".nowrop");
  
  console.log(pages.length)
  var nowpage=0;//定义当前页，默认为0
  nowrop.innerHTML="共"+lis+"条&nbsp;&nbsp;"+(nowpage+1)+"/"+pages.length
  next.onclick=function(){
    nowpage++;
    nowpage %=pages.length
    toggle(pages, nowpage)
  }
  prev.onclick=function(){
    nowpage--;
    nowpage %=pages.length
    toggle(pages, nowpage)
  }
  first.onclick=function(){
    nowpage=0;
    toggle(pages, nowpage)
  }
  last.onclick=function(){
    nowpage=pages.length-1;
    toggle(pages, nowpage)
  }
  jump.onclick=function(){
    nowpage=yema.value-1;
    yema.value="";
    toggle(pages, nowpage)
  }